//
//  StockTableViewCell.m
//  代理端
//
//  Created by mac on 16/3/5.
//  Copyright © 2016年 sliver. All rights reserved.
//

#import "StockTableViewCell.h"

@interface StockTableViewCell()
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;

@property (weak, nonatomic) IBOutlet UILabel *productLable;
@property (weak, nonatomic) IBOutlet UILabel *typeLable;
@property (weak, nonatomic) IBOutlet UILabel *countLable;

@end
@implementation StockTableViewCell

- (void)awakeFromNib {
    self.iconImageView.layer.masksToBounds = YES;
    
    self.iconImageView.layer.cornerRadius = 5;
    
    [AutoLayoutUtil autoLayoutWith:self.contentView.subviews];
    
    self.selectionStyle=UITableViewCellSelectionStyleNone;
    
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)gaveMemodel:(StockModel *)model
{
    self.productLable.text = model.commodity_name;
    self.typeLable.text = model.commodity_mode_name;
    self.countLable.text = [NSString stringWithFormat:@"x%@件",model.count];
//    NSString *imageurl;
//    NSArray *array = [model.imgList JSONValue];
//    for (NSDictionary *dic in array) {
//        imageurl = dic[@"imgurl"];
//    }
    NSString *str =[NSString stringWithFormat:@"%@%@",BASE_URL,model.imgurl];
    
    NSURL  *url = [NSURL URLWithString:str];
    
    [self.iconImageView setImageWithURL:url placeholderImage:[UIImage imageNamed:@"kucunzhanwei.png"]];

}
@end
